﻿<phone:PhoneApplicationPage
  x:Class="Renren.Pages.MainPage"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
  xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
  xmlns:controls="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"
  xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"
  FontFamily="{StaticResource PhoneFontFamilyNormal}"
  FontSize="{StaticResource PhoneFontSizeNormal}"
  Foreground="{StaticResource PhoneForegroundBrush}"
  SupportedOrientations="Portrait"  Orientation="Portrait"
  shell:SystemTray.IsVisible="False"
  
  d:DataContext="{d:DesignData /SampleData/MainPageViewModel.xaml}"
  xmlns:local="clr-namespace:Utils.UIEffect"
  xmlns:renren="clr-namespace:Renren.Controls"
  local:TiltEffect.IsTiltEnabled="True">

  <!--LayoutRoot is the root grid where all page content is placed-->
  <Grid x:Name="LayoutRoot" Background="Transparent" Margin="0,32,0,0">

    <renren:TitleBlock Source="/Images/home.png"
                            Text="人人WP7"
                            Margin="20,0"
                            VerticalAlignment="Top" />
    
    <!--Pivot Control-->
    <controls:Pivot Title=" ">
      
      <!--Newsfeed Pivot-->
      <controls:PivotItem  Header="新鲜事">
        <renren:StreamBox x:Name="NewsStreamBox" ItemsSource="{Binding NewsList}"
                          TailIdleText="更多新鲜事">
          <renren:StreamBox.ItemTemplate>
            <DataTemplate>
              <renren:NewsBox Margin="0,0,0,20" />
            </DataTemplate>
          </renren:StreamBox.ItemTemplate>
        </renren:StreamBox>
      </controls:PivotItem>
      
      <!--Friends Pivot-->
      <controls:PivotItem Header="好友">
        <renren:FriendStreamBox x:Name="FriendStreamBox"
                                d:DataContext="{d:DesignData SampleData/GlobalViewModel.xaml}" />
      </controls:PivotItem>
      
    </controls:Pivot>
  </Grid>

  <!--Application bar-->
  <phone:PhoneApplicationPage.ApplicationBar>
    <shell:ApplicationBar IsVisible="True" Mode="Minimized" IsMenuEnabled="True" Opacity="0.5">
      <shell:ApplicationBarIconButton IconUri="Images/AppBar/status.png" Text="状态" Click="StatusButton_Clicked" />
      <shell:ApplicationBarIconButton IconUri="Images/AppBar/camera.png" Text="照片" />
      <shell:ApplicationBarIconButton IconUri="Images/AppBar/search.png" Text="Test" Click="SearchButton_Clicked" />
      <shell:ApplicationBarIconButton IconUri="Images/AppBar/checkin.png" Text="报到" />
      <shell:ApplicationBar.MenuItems>
        <!--<shell:ApplicationBarMenuItem Text="toggle debug mode" Click="ToggleDebugMode"/>
        <shell:ApplicationBarMenuItem Text="toggle cache" Click="ToggleCache"/>-->
        <shell:ApplicationBarMenuItem Text="退出" Click="Logout_Clicked"/>
      </shell:ApplicationBar.MenuItems>
    </shell:ApplicationBar>
  </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>